package com.gdc.cloud.service;

import com.gdc.cloud.service.impl.PaymentFallbackService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * Description: 支付 Feign 业务接口
 *
 * | @FeignClient                       表示 Feign 接口, value值，表示 调用的业务实例
 *                                          fallback参数：引用 回调实现类
 * 注意：一定、一定、一定 要使用 @Component 注解，将当前类注入到Spring中
 *
 * @author: gdc
 * @date: 2021/2/2
 * @version 1.0
 */
@FeignClient(value = "CLOUD-PAYMENT-HYSTRIX-SERVICE", fallback = PaymentFallbackService.class)
@Component
public interface PaymentHystrixService {

    @GetMapping("/payment/hystrix/ok/{id}")
    String paymentInfo_OK(@PathVariable("id") Integer id);

    @GetMapping("/payment/hystrix/timeout/{id}")
    String paymentInfo_Timeout(@PathVariable("id") Integer id);

}
